#ifndef __HDVB_TUNING_H
#define __HDVB_TUNING_H
/*
    libhdvbd - Library for building sophisticated DVB applications
    Copyright (C) 2012 Tony Houghton <h@realh.co.uk>

    This program is free software; you can redistribute it and/or modify
    it under the terms of the GNU Lesser General Public License as published by
    the Free Software Foundation; either version 3 of the License, or
    (at your option) any later version.

    This program is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
    GNU Lesser General Public License for more details.

    You should have received a copy of the GNU Lesser General Public License
    along with this program; if not, write to the Free Software
    Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
*/

/* Enhanced tuning data structure and routines to convert to and from string */ 

#include <glib.h>

#include <linux/dvb/frontend.h>

G_BEGIN_DECLS

#define HDVB_TUNING_MAX_PROPS 16

typedef struct {
    fe_type_t                       type;
    struct dtv_property             props[HDVB_TUNING_MAX_PROPS];
    struct dtv_properties           pprops;
    /* tone for DVB-S only */
    fe_sec_tone_mode_t              tone;
} HdvbTuningData;

/* Returns FALSE on failure. It will do its best to fill in data with defaults
 * anyway, but if the string's really screwed frequency will be 0.
 */
gboolean
hdvb_tuning_string_to_data(const char *str, HdvbTuningData *data);

/* Returned string is allocated */
char *
hdvb_tuning_data_to_string(const HdvbTuningData *data);

/* Tests whether two tuning_strs can be considered to refer to the same
 * transponder/channel
 */
gboolean
hdvb_tuning_strs_are_similar(const char *t1, const char *t2);

fe_type_t
hdvb_tuning_char_to_type(char c);


G_END_DECLS

#endif /* __HDVB_TUNING_H */
